# 案例3:发送邮件

# 版本1
# def send_email(recipient, subject, content, cc=None, bcc=None):
#     print("连接服务器")
#     print(f"收件人邮箱:{recipient}")
#     print(f"主题:{subject}")
#     print(f"内容:{content}")
#     if cc:
#         print(f"cc:{cc}")
#     if bcc:
#         print(f"bcc:{bcc}")
#
# r = "yuan@qq.com"
# c = "Yuan老师，您太辛苦，给您涨薪十万元！"
# s = "重要通知"
# send_email(r, s, c)


# 版本2
# *args用于接收任意数量的位置参数
# **kwargs用于接收任意数量的关键字参数。
# def send_email(recipient, subject, content, **kwargs):
#     print("连接服务器")
#     print(f"收件人邮箱:{recipient}")
#     print(f"主题:{subject}")
#     print(f"内容:{content}")
#     print("kwargs:", kwargs)
#     cc = kwargs.get("cc")
#     bcc = kwargs.get("bcc")
#     if cc:
#         print("抄送人：", cc)
#     if bcc:
#         print("密送人：", bcc)
#
#
# r = "yuan@qq.com"
# c = "Yuan老师，您太辛苦，给您涨薪十万元！"
# s = "重要通知"
# send_email(r, s, c, cc="alex@qq.com", bcc="rain@qq.com")
# send_email(r, s, c, bcc="rain@qq.com")
# send_email(r, s, c, cc="alex@qq.com")


# *args和**kwargs的结合


# def test(a, *b, **c):
#     print(a)
#     print(b)
#     print(c)
#
#
# test(1, 2, 3, 4, 5, 6, x=10, y=20, z=30)
